package synchronicity.io;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

/**
 * An Serializable interface for j2me. Defines read() and write() methods for
 * objects so they can be written out to a DataInput/OutputStream. Note: This
 * implementation relies on an external type checking mechanism, and an object
 * must be instantiated before it is deserialized.
 * 
 * I used the method of having a Factory class responsible for creating objects
 * given a type string, which is obtained from the object being serialized. See
 * Agent.java, AgentFactory.java, SchedulerHostSkeleton.java, and
 * SchedulerHostStub.java
 */
public interface Streamable {
	public void read(DataInputStream stream) throws IOException;

	public void write(DataOutputStream stream) throws IOException;
}
